<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>user_basic_info</title>
<script type="text/javascript" src="/networkforum/js/Calendar3.js"></script>
<link rel="stylesheet" href="/networkforum/css/user_info.css" />
<!–[if lt IE9]> 
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]–>
<style type="text/css">

</style>
<script type="text/javascript" src="/networkforum/js/checkData.js"></script>
<script type="text/javascript">

window.onload = function(){
	//登录页面后通过myajax获取进一步的信息
	var myajax = getByAjax();
	myajax.init(null,"get",true);
	myajax.get("/networkforum/user/basic_info.do",showBasic);
}
function showBasic(d){
	//var data = eval("("+d+")");
	var data = toJson(d);
	document.getElementById("userName").value = data.userName;
	document.getElementById("userMobile").value = data.userEmail;
	document.getElementById("QQ").value = data.userQQ;
	if(data.userSex == "男"){
		document.getElementById("boy").checked="checked";
	}
	else{
		document.getElementById("girl").checked="checked";
	}
	document.getElementById("userBirthday").value = data.userBirthday;

	document.getElementById("userPlace").value = data.userPlace;
	document.getElementById("userWork").value = data.userWork;
}

function checkForm(){ 
	var isPass = true;
	if(!(checkData.isEmptySpan("userMobile") && checkData.isEmailSpan('userMobile'))) 
			isPass = false; 
	if(!(checkData.isEmptySpan("QQ"))) 
			isPass = false;
	if(!(checkData.isNumSpan('QQ'))) 
			isPass = false; 
	if(!(checkData.isEmptySpan("userPlace"))) 
			isPass = false;
	if(!(checkData.isEmptySpan("userWork"))) 
			isPass = false;
		return isPass; 
}
</script>
</head>

<body>
	<h2>基本资料</h2>
    <form method="get" action="/networkforum/user/update_user.do" target="mright" onsubmit="return checkForm();">
        <section class="user_name">
        	<h5>昵称:</h5>
            <input name="userName" id="userName" type="text" disabled="disabled" />
        </section>
        <section class="user_phone">
        	<h5>邮箱:</h5>
            <input name="userEmail" id="userMobile" type="text" />
        </section>
        <section class="user_qq">
        	<h5>QQ:</h5>
            <input name="userQQ" id="QQ" type="text" />
        </section>
        <section class="user_sex">
        	<h5>性别:</h5>
            <input id="boy" type="radio" value = "男" name="userSex"/>男
            <input id="girl" type="radio" value = "女" checked="checked" name="userSex"/>女
        </section>
        <section class="user_birthday">
        	<h5>生日:</h5>
            <input name="userBirthday" id="userBirthday" type="text" onclick="new Calendar().show(this);" readonly="readonly" />
        </section>
        <!-- <section class="user_marriage">
        	<h5>婚姻状态:</h5>
            <input name="isMarried" id="marry" type="radio"/>未婚
            <input name="isMarried" id="nomarry" type="radio"/>已婚
        </section> -->
        <section class="user_borth_place">
        	<h5>地区:</h5>
            <input name="userPlace" id="userPlace" type="text" />
        </section>
        <section class="user_work">
        	<h5>工作行业:</h5>
            <input name="userWork" id="userWork" type="text" />
        </section>
        <div class="sub">
        <input type="submit" value="保存" />
        <input type="reset" value="重置" />
        </div>
    </form>
</body>
<script type="text/javascript" src="/networkforum/js/myajax.js"></script>
</html>
